-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ConverterFilterKind enum to be flags #1252
Conversation
Left = TopLeft | BottomLeft, | ||
Bottom = BottomLeft | BottomRight, | ||
Right = TopRight | BottomRight, | ||
ValueOnly = 0x0010, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of ValueOnly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to work around the CX binding bug we saw in the email thread. See #1239.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jevansaks Looks like CX doesn't support value combinations like Here's the generated code in metadata provider, XamlMetadataProvider::RegisterXamlType(
/* Arg1 TypeName */
L"Microsoft.UI.Xaml.Controls.Primitives.CornerRadiusFilterKind",
/* Arg2 CreateXamlTypeCallback */
[]()
{
auto xamlType = winrt::make<EnumXamlType>(
/* Arg 1 - TypeName */
(PCWSTR)L"Microsoft.UI.Xaml.Controls.Primitives.CornerRadiusFilterKind",
/* Arg 2 - CreateFromString func */
(std::function<winrt::IInspectable(hstring)>)[](hstring fromString)
{
if (fromString == L"None") return box_value(winrt::CornerRadiusFilterKind::None);
if (fromString == L"TopLeft") return box_value(winrt::CornerRadiusFilterKind::TopLeft);
if (fromString == L"TopRight") return box_value(winrt::CornerRadiusFilterKind::TopRight);
if (fromString == L"BottomLeft") return box_value(winrt::CornerRadiusFilterKind::BottomLeft);
if (fromString == L"BottomRight") return box_value(winrt::CornerRadiusFilterKind::BottomRight);
if (fromString == L"Top") return box_value(winrt::CornerRadiusFilterKind::Top);
if (fromString == L"Left") return box_value(winrt::CornerRadiusFilterKind::Left);
if (fromString == L"Bottom") return box_value(winrt::CornerRadiusFilterKind::Bottom);
if (fromString == L"Right") return box_value(winrt::CornerRadiusFilterKind::Right);
if (fromString == L"ValueOnly") return box_value(winrt::CornerRadiusFilterKind::ValueOnly);
throw winrt::hresult_invalid_argument();
});
return xamlType;
}); |
Oh, shucks. Yeah let's go with what's in master for this release. Can you file a bug on markup, then circle back on the spec review and say we can't do this because of that bug? |
Yeah, will do. |
Idea comes from this API review comment https://github.com/microsoft/microsoft-ui-xaml-specs/pull/48/files#r317833889.
ConverterFilterKind is now a flag, that enables us to combine values like below